package com.gqyin.demo.exception;

import com.gqyin.demo.common.ResponseCode;

/**
 * @author guiqing.yin
 * 2024-04-07 15:42
 */
public class TestException extends RuntimeException {
    private final ResponseCode code;

    public TestException(ResponseCode code) {
        super(code.getDesc());
        this.code = code;
    }

    public TestException(String message, ResponseCode code) {
        super(message);
        this.code = code;
    }

    public TestException(String message, Throwable cause, ResponseCode code) {
        super(message, cause);
        this.code = code;
    }

    public TestException(Throwable cause, ResponseCode code) {
        super(cause);
        this.code = code;
    }

    public ResponseCode getCode() {
        return code;
    }
}
